Page({
  data: {},
  goGfKb(){
    let link=`https://console-snipcode.taobao.com/miniapp/data/board#/?appId=3000000048925193`;
    my.qn.navigateToWebPage({
      url: link,
      success: res => {
      },
      fail: res => {
      }
    });
  },

  dateSelect(e){
    this.setData({
      startTime:e.detail.value[0],
      endTime:e.detail.value[1]
    })
  },

  getBasePointList(){
    console.log(this.data.startTime,this.data.endTime)
    this.getData(this.data.startTime,this.data.endTime)
  },

  getData(startTime,endTime){
    getApp().cloud.function.invoke('client',{startTime:startTime,endTime:endTime},"getBasePointList").then(res => {
      console.log("埋点数据",res)
      if(res.code == 200){
        this.setData({
          dataA:res.data
        })
      }
    })
  },
  onLoad() {

    let today = new Date();
    let Y = today.getFullYear();
    let M = today.getMonth()+1;
    let D = today.getDate();
    today = `${Y}-${M}-${D}`
 
    this.getData(today,today);
  },
});
